home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
turbovis
/
tvmagic1.zip
/
DLGTEST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-06-10
|
4KB
|
129 lines
uses App,Objects,Drivers,Dialogs,MagicDlg,Views;
{ Hint: Press ALT-I in the first dialogbox and CTRL-O in the next one }
type PMovingAboutBox=^TMovingAboutBox;
TMovingAboutBox=object(TMovingMagicDialog)
function GetNormalText(i:word):string;virtual;
function GetMagicText(i:word):string;virtual;
function NumberOfLines:word;virtual;
function FreeLines:word;virtual;
end;
PStaticAboutBox=^TStaticAboutBox;
TStaticAboutBox=object(TStaticMagicDialog)
function GetNormalText(i:word):string;virtual;
function GetMagicText(i:word):string;virtual;
function NumberOfLines:word;virtual;
function FreeLines:word;virtual;
end;
function TMovingAboutBox.GetMagicText(i:word):string;
const text:array[0..17] of string=
('',
'',
'',
' Hi! I''m a magic dialogbox-virus ',
' Copy me in your applications ',
' and join in! (c) MavEtJu ',
'',
' If you like this kind of dialogboxes',
' and will continue to use this unit, ',
' would you be so nice to send a ',
' postcard from your ',
' town/city/metropole to ',
'',
' Edwin Groothuis ',
' Johann Strausslaan 1 ',
' 5583ZA Aalst-Waalre ',
' The Netherlands ',
'.');
begin
if i>=NumberOfLines then
GetMagicText:=''
else
GetMagicText:=text[i];
end;
function TMovingAboutBox.GetNormalText(i:word):string;
const text:array[0..3] of string=
('MavEtJu presents: The Magic Dialogs',
'',
' Press Control-O for the show! ',
'');
begin
if i>=FreeLines then
GetNormalText:=''
else
GetNormalText:=text[i];
end;
function TMovingAboutBox.NumberOfLines:word;
begin
NumberOfLines:=18;
end;
function TMovingAboutBox.FreeLines:word;
begin
FreeLines:=4;
end;
function TStaticAboutBox.GetMagicText(i:word):string;
const text:array[0..3] of string=
(' Hi! I''m a magic dialogbox-virus ',
' Copy me in your applications ',
' and join in! ',
' (c) MavEtJu ');
begin
if i>=NumberOfLines then
GetMagicText:=''
else
GetMagicText:=text[i];
end;
function TStaticAboutBox.GetNormalText(i:word):string;
const text:array[0..3] of string=
('MavEtJu presents: The Magic Dialogs',
'',
' Press ALT-I for the show! ',
'');
begin
if i>=FreeLines then
GetNormalText:=''
else
GetNormalText:=text[i];
end;
function TStaticAboutBox.NumberOfLines:word;
begin
NumberOfLines:=4;
end;
function TStaticAboutBox.FreeLines:word;
begin
FreeLines:=4;
end;
var A:TApplication;
DS:PStaticAboutBox;
DM:PMovingAboutBox;
R:TRect;
begin
A.Init;
R.Assign(1,1,40,10);
DS:=New(PStaticAboutBox,Init(R,'Static Magic Dialog',GetAltCode('I')));
R.Assign(10,6,30,8);
DS^.Insert(New(PButton,Init(R,'Ok',cmOk,bfDefault)));
DeskTop^.ExecView(DS);
Dispose(DS,Done);
R.Assign(1,1,40,10);
DM:=New(PMovingAboutBox,Init(R,'Moving Magic Dialog',GetCtrlCode('O')));
R.Assign(10,6,30,8);
DM^.Insert(New(PButton,Init(R,'Ok',cmOk,bfDefault)));
DeskTop^.ExecView(DM);
Dispose(DM,Done);
A.Run;
A.Done;
end.